package com.woniuxy.cloud.userassembly.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.cloud.entity.TUserRecord;
import com.woniuxy.cloud.form.AddUserRecordForm;
import com.woniuxy.cloud.userassembly.mapper.TUserRecordMapper;
import com.woniuxy.cloud.userassembly.service.ITUserRecordService;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 * 用户余额记录表 服务实现类
 * </p>
 *
 * @author Lucas
 * @since 2021-10-09
 */
@Service
public class TUserRecordServiceImpl extends ServiceImpl<TUserRecordMapper, TUserRecord> implements ITUserRecordService {


    @Override
    public Integer insertUserRecord(AddUserRecordForm addUserRecordForm) {
        TUserRecord tUserRecord = new TUserRecord();
        tUserRecord.setUserRecordUserId(addUserRecordForm.getUserId()).setUserRecordOperationTime(addUserRecordForm.getOperationTime()).setUserRecordUserBalance(addUserRecordForm.getUserBalance()).setUserRecordDetails(addUserRecordForm.getDetails());
        return getBaseMapper().insert(tUserRecord);
    }
}
